package com.fifth.order.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fifth.common.pojo.entity.Order;
import com.fifth.order.vo.GetOrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;
import java.util.Map;

/**
 * @作者：刘壬杉
 * @创建时间 2022/9/1 9:48
 **/
@Mapper
public interface OrderMapper extends BaseMapper<Order> {
    /*批量添加到订单表*/
    Integer insertByGoodsids(List<GetOrderVo> getOrderVos);

    /*根据订单编号查询订单信息*/
    List<Map> selectByCode(String code);

    /*分页查询订单*/
    IPage<Order> findOrder(IPage<Order> page,@Param("ew") QueryWrapper<Order> queryWrapper);

    /*根据code查询商品*/
    List<Order> selectGoodsByCode( List<String> codes);

    /*根据goodsid获取商品成交量*/
    Integer getGoodsSellNum(String goodsid);

    /*商家订单管理的页面加载*/
    List<Order> selectAllOrders(List<String> allCode,@Param("userid") String userid);

    /*获取分页个数的订单号*/
    IPage<Order> getCodes(IPage<Order> page,@Param("ew") QueryWrapper<Order> queryWrapper);
}
